import request from '@/utils/request'

export default {
  // 场所记录
  getAllPlaces (data) {
    const url = 'epidemics/place'
    return request.get(url, data)
  },
  getPlaceList (data) {
    const url = 'epidemics/place/list'
    return request.get(url, data)
  },
  addPlace (data) {
    const url = 'epidemics/place'
    return request.post(url, data)
  },
  updatePlace (data) {
    const url = 'epidemics/place'
    return request.put(url, data)
  },
  deletePlace (data) {
    const url = 'epidemics/place'
    return request.delete(url, data)
  },

  // 设备记录
  getAllDevice (data) {
    const url = 'epidemics/device'
    return request.get(url, data)
  },
  getDeviceList (data) {
    const url = 'epidemics/device/list'
    return request.get(url, data)
  },
  addDevice (data) {
    const url = 'epidemics/device'
    return request.post(url, data)
  },
  updateDevice (data) {
    const url = 'epidemics/device'
    return request.put(url, data)
  },
  deleteDevice (data) {
    const url = 'epidemics/device'
    return request.delete(url, data)
  },
  updateStatus (data) {
    const url = 'epidemics/device/update/status'
    return request.put(url, data)
  },
  getFaceDstributionRecords (data) {
    const url = 'epidemics/device/persons'
    return request.get(url, data)
  },
  deleteDevicePersonsDstributionRecords (data) {
    const url = 'epidemics/device/del/persons'
    return request.postJson(url, data)
  },
  deleteDeviceAllPersonsDstributionRecords (data) {
    const url = 'epidemics/device/del/allPersons'
    return request.postJson(url, data)
  },

  // 通行记录
  getAccessRecordList (data) {
    const url = 'epidemics/accessRecord/list'
    return request.get(url, data)
  },
  deleteAccessRecord (data) {
    const url = 'epidemics/accessRecord'
    return request.delete(url, data)
  },
  downLoadAccessRecord (data, filename) {
    const url = 'epidemics/accessRecord/excelAccessRecord'
    return request.download(url, data, filename)
  },
  excelAccessRecord () {
    const url = 'epidemics/accessRecord/excelAccessRecord'
    return request.post(url)
  },

  // 人员记录
  getPersonList (data) {
    const url = 'epidemics/person/list'
    return request.get(url, data)
  },
  addPerson (data) {
    const url = 'epidemics/person'
    return request.post(url, data)
  },
  updatePerson (data) {
    const url = 'epidemics/person'
    return request.put(url, data)
  },
  deletePerson (data) {
    const url = 'epidemics/person'
    return request.delete(url, data)
  },
  distributionPerson (data) {
    const url = 'epidemics/person/issueEpidemics'
    return request.postJson(url, data)
  },
  getFaceIssueLogList (data) {
    const url = 'epidemics/faceIssueLog/list'
    return request.get(url, data)
  },
  getPersonDevices (data) {
    const url = 'epidemics/person/devices'
    return request.get(url, data)
  },
  deletePersonAllDevices (data) {
    const url = 'epidemics/person/del/allDevice'
    return request.get(url, data)
  },

  // 告警记录
  getAlertlist (data) {
    const url = 'epidemics/accessRecord/alertlist'
    return request.get(url, data)
  },
  downLoadAlertRecord (data, filename) {
    const url = 'epidemics/accessRecord/excelAlert'
    return request.download(url, data, filename)
  },
  getIdentityCard (data) {
    const url = 'epidemics/accessRecord/identityCard'
    return request.get(url, data)
  },

  // 数据统计
  // 健康码统计
  getHealthCodeStatistics () {
    const url = 'epidemics/accessRecord/statistics'
    return request.get(url)
  },

  // 体温统计
  getTemperatureStatistics () {
    const url = 'epidemics/accessRecord/temperature'
    return request.get(url)
  },

  // 访客来源
  getVisitorSource () {
    const url = 'epidemics/accessRecord/regionDistribution'
    return request.get(url)
  },

  // 人流量统计
  getVisitorsFlowrateStatistics (data) {
    const url = 'epidemics/accessRecord/flowrate'
    return request.get(url, data)
  },

  // 访客记录
  getVisitorsRecord () {
    const url = 'epidemics/accessRecord/list'
    return request.get(url)
  },
}
